package com.kongwg.exer;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kongwg
 * @create 2020-12-11 22:23
 */
public class ListExer {

    @Test
    public void testListRemove() {
        List list = new ArrayList();
        list.add(1);
        list.add(2);
        list.add(3);
        updateList(list);
        System.out.println(list);//
    }

    private void updateList(List list) {
        list.remove(2);//索引为2
        list.remove(new Integer(2));//值为2
    }

}
